<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=emulateIE7" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="{{ asset('/admins/css/bootstrap.min.css') }}" rel="stylesheet"> 
    <script src="{{ asset('/admins/js/jquery.min.js') }}"></script>
    <script src="{{ asset('/admins/js/bootstrap.min.js') }}"></script>
</head>
<body>
   <section id="main-content" style="width:500px; margin:0 auto;">
                            <div class="row">
                <div class="col-lg-12">
                    <h1 class="page-header">分类修改</h1>
                </div>
                <!-- /.col-lg-12 -->
            </div>
                @if(session('error'))
                    <div class="alert alert-warning">
                               {{ session('error') }}
                    </div>
                @endif
           <div class="panel panel-default">
                        
                        <div class="panel-heading">
                            分类修改
                        </div>

                        <div class="panel-body">
                            <div class="row">
                                <div class="col-lg-6 col-lg-offset-3">
                                    <form role="form" action="/admin/goodscate/{{$cate->id}}" method="post">
                                      <!--  -->
                                        
                                        <div class="form-group" >
                                            <label>上级分类</label>
                                            <select name="cid" class="form-control">
                                            <option>顶级分类</option>
                                            @foreach($cates as $k=>$v)
                                                @if($v->id == $cate->cid){
                                                    <option value="{{$v->id}}" selected>{{$v->name}}</option>
                                                }
                                                @else
                                                    <option value="{{$v->id}}" >{{$v->name}}</option>
                                                @endif
                                            @endforeach
                                            </select>
                                            
                                        </div>
                                        <div class="form-group">
                                            <label>分类名</label>
                                            <input class="form-control" name="name" value="{{$cate->name}}" type="text">
                                        </div>
                                        <div class="form-group">
                                            <label>状态</label>
                                            <label class="radio-inline">
                                                <input name="status" id="optionsRadiosInline1" value="1" {{ $cate->status == 1 ? 'checked="checked"' :''}} type="radio">开启
                                            </label>
                                            <label class="radio-inline">
                                                <input name="status" id="optionsRadiosInline2" value="0" {{ $cate->status == 0 ? 'checked="checked"' :''}} type="radio">关闭
                                            </label>
                                            
                                        </div>
                                       <!-- {{ csrf_field() }} -->
                                       {{ method_field('PUT') }}
                                        <input name="_token" value="{{ csrf_token() }}" type="hidden">
                                        <input type="hidden" name="id" value="{{$cate->id}}">
                                        <input type="hidden" name="xpid" value="{{$cate->cid}}">

                                        <button type="submit" class="btn btn-primary">确定</button>
                                        <button type="reset" class="btn btn-danger">重置</button>
                                    </form>
                                </div>
                                <!-- /.col-lg-6 (nested) -->
                                
                                <!-- /.col-lg-6 (nested) -->
                            </div>
                            <!-- /.row (nested) -->
                        </div>
                        <!-- /.panel-body -->
                    </div>
                <!--ToDo end-->
            </section>

